<?php
namespace app\agent\controller\feedback;
use app\agent\controller\Controller;
use app\common\model\feedback\FeedbackAgent;
/**
 *  代理反馈意见
 * Class Agent
 * @package app\agent\controller\feedback
 */
class Agent extends Controller
{

      public function index(){
          $model = new FeedbackAgent;
          if (!$this->request->isAjax()) {
              return $this->fetch('index');
          }

          // 新增记录
          if ($model->add($this->postData('agent'))) {
              return $this->renderSuccess('添加成功', url('agent/index'));
          }
          return $this->renderError($model->getError() ?: '添加失败');
      }


}